package top.go2do.websiteNavigation.business.website.module;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @Description
 * @Author xingyj
 * @CreateTime 2025/6/26 13:56
 */
@Entity
@Table(name = "search_stats")
@Data
public class SearchStatsPO {
    @Id
    @Column(name = "search_id", columnDefinition = "BIGINT UNSIGNED COMMENT '全局唯一搜索ID'")
    private Long searchId;

    @Column(name = "keyword", nullable = false, columnDefinition = "VARCHAR(100) COMMENT '搜索的关键词'")
    private String keyword;

    @Column(name = "result_count", columnDefinition = "INT DEFAULT 1 COMMENT '关键词的搜索次数'")
    private Integer resultCount;

    @Column(name = "searched_at", nullable = false, insertable = false, updatable = false,
            columnDefinition = "DATETIME(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6) COMMENT '搜索时间'")
    private LocalDateTime searchedAt;
}
